<?php

namespace app\storeapi\controller;

use app\storeapi\model\User as UserModel;

/**
 * 登录
 * Class User
 * @package app\api
 */
class Login extends Controller
{

    /**
     * 用户自动登录
     * @return array
     * @throws \app\common\exception\BaseException
     * @throws \think\Exception
     * @throws \think\exception\DbException
     */
    public function login()
    {
        $model = new UserModel;
        //登录逻辑
        $model->login($this->request->post());

        return $this->renderSuccess([
            'token' => $model->getToken()
        ]);
    }




}
